home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / RIncludes / LocationManager.r < prev    next >
Encoding:
Text File  |  1997-08-12  |  6.4 KB  |  173 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        LocationManager.r
  3.  
  4.      Contains:    LocationManager (manage preferences for different physical Locations)
  5.  
  6.      Version:    Technology:    System 7.6
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18.  
  19. #ifndef __LOCATIONMANAGER_R__
  20. #define __LOCATIONMANAGER_R__
  21.  
  22. #ifndef __CONDITIONALMACROS_R__
  23. #include "ConditionalMacros.r"
  24. #endif
  25.  
  26. /* Location Manager API Support -------------------------------------------------------------------- */
  27. /* A Location Token uniquely identifies a Location on a machine... */
  28.  
  29. #define kALMNoLocationToken             (-1)                /*  ALMToken of "off" Location... */
  30. #define kALMLocationNameMaxLen             31                    /*  name (actually imposed by file system)...  */
  31. #define kALMMaxLocations                 16                    /*  arbitrary limit enforced by Location Manager...  */
  32. #define kALMNoLocationIndex             (-1)                /*  index for the "off" Location (kALMNoLocationToken)...  */
  33.  
  34. /* Returned from ALMConfirmName... */
  35. #define kALMConfirmRename                 1
  36. #define kALMConfirmReplace                 2
  37.  
  38. /* ALMConfirmName dialog item numbers for use in callbacks (ALM 2.0)... */
  39.  
  40. #define kALMDuplicateRenameButton         1                    /*  if Window refcon is kALMDuplicateDialogRefCon...  */
  41. #define kALMDuplicateReplaceButton         2
  42. #define kALMDuplicateCancelButton         3
  43. #define kALMDuplicatePromptText         5
  44.  
  45. #define kALMRenameRenameButton             1                    /*  if Window refcon is kALMRenameDialogRefCon...  */
  46. #define kALMRenameCancelButton             2
  47. #define kALMRenameEditText                 3
  48. #define kALMRenamePromptText             4
  49.  
  50. /* Refcons of two windows in ALMConfirmName (ALM 2.0)... */
  51.  
  52. #define kALMDuplicateDialogRefCon         'dupl'
  53. #define kALMRenameDialogRefCon             'rnam'
  54.  
  55. /* Callback routine for Location awareness (mimics AppleEvents) in non-application code... */
  56.  
  57. /* Notification AppleEvents sent to apps/registered code...  */
  58. #define kAELocationChangedNoticeKey     'walk'                /*  Current Location changed...  */
  59. #define kAELocationRescanNoticeKey         'trip'                /*  Location created/renamed/deleted...  */
  60.  
  61. /* ALMSwitchToLocation masks... */
  62.  
  63. #define kALMDefaultSwitchFlags             0x00000000            /*  No special action to take...  */
  64. #define kALMDontShowStatusWindow         0x00000001            /*  Suppress "switching" window...  */
  65. #define kALMSignalViaAE                 0x00000002            /*  Switch by sending Finder AppleEvent...  */
  66.  
  67. /* Parameters for Get/Put/Merge Location calls... */
  68.  
  69. #define kALMAddAllOnSimple                 0                    /*  Add all single-instance, non-action modules...  */
  70. #define kALMAddAllOff                     (-1)                /*  Add all modules but turn them off...  */
  71.  
  72. /* Item numbers for use in Get/Put/Merge Location filters... */
  73.  
  74. #define kALMLocationSelectButton         1
  75. #define kALMLocationCancelButton         2
  76. #define kALMLocationBalloonHelp         3
  77. #define kALMLocationLocationList         7
  78. #define kALMLocationLocationNameEdit     10
  79. #define kALMLocationPromptText             11
  80.  
  81. #define kALMLocationSaveButton             1
  82. /* Location Manager Module API Support ------------------------------------------------------------- */
  83.  
  84. /* ALMGetScriptInfo stuff... */
  85.  
  86. #define kALMScriptInfoVersion             2                    /*  Customarily put in resource for localization...  */
  87. /*
  88.    Alternate form of ScriptInfo is easier to localize in resources; it is used extensively in
  89.    samples and internally, so....
  90. */
  91. #define kALMAltScriptManagerInfoRsrcType  'trip'
  92. #define kALMAltScriptManagerInfoRsrcID     0
  93.  
  94. type kALMAltScriptManagerInfoRsrcType {
  95.     integer;    // version = kALMScriptInfoVersion
  96.     integer;    // scriptCode (eg. smRoman)
  97.     integer;     // regionCode (eg. versUS)
  98.     integer;     // langCode (eg. langEnglish)
  99.     integer;    // fontSize
  100.     pstring;    // fontName
  101. };
  102. /* Reboot information used on ALMSetCurrent (input/output parameter)... */
  103.  
  104. #define kALMNoChange                     0
  105. #define kALMAvailableNow                 1
  106. #define kALMFinderRestart                 2
  107. #define kALMProcesses                     3
  108. #define kALMExtensions                     4
  109. #define kALMWarmBoot                     5
  110. #define kALMColdBoot                     6
  111. #define kALMShutdown                     7
  112.  
  113. /*
  114.    File types and signatures...
  115.    Note: auto-routing of modules will not be supported for 'thng' files...
  116. */
  117.  
  118. #define kALMFileCreator                 'fall'                /*  Creator of Location Manager files...  */
  119. #define kALMComponentModuleFileType     'thng'                /*  Type of a Component Manager Module file [v1.0]...  */
  120. #define kALMComponentStateModuleFileType  'almn'            /*  Type of a CM 'state' Module file...  */
  121. #define kALMComponentActionModuleFileType  'almb'            /*  Type of a CM 'action' Module file...  */
  122. #define kALMCFMStateModuleFileType         'almm'                /*  Type of a CFM 'state' Module file...  */
  123. #define kALMCFMActionModuleFileType     'alma'                /*  Type of a CFM 'action' Module file...  */
  124.  
  125. /* Component Manager 'thng' info... */
  126.  
  127. #define kALMComponentRsrcType             'thng'
  128. #define kALMComponentType                 'walk'
  129.  
  130. /* CFM Modules require a bit of information (replacing some of the 'thng' resource)... */
  131.  
  132. #define kALMModuleInfoRsrcType             'walk'
  133. #define kALMModuleInfoOriginalVersion     0
  134.  
  135. type kALMModuleInfoRsrcType {
  136.     switch {
  137.         case Original:
  138.             key longint = kALMModuleInfoOriginalVersion;
  139.             literal longint;         // Subtype
  140.             literal longint;         // Manufacturer
  141.             unsigned hex longint;     // Flags
  142.     };
  143. };
  144. /* These masks apply to the "Flags" field in the 'thng' or 'walk' resource... */
  145.  
  146. #define kALMMultiplePerLocation         0x00000001            /*  Module can be added more than once to a Location...  */
  147. #define kALMDescriptionGetsStale         0x00000002            /*  Descriptions may change though the setting didn't...   */
  148.  
  149. /* Misc stuff for older implementations ------------------------------------------------------------ */
  150.  
  151. /* Old error codes for compatibility - new names are in Errors interface... */
  152. #if OLDROUTINENAMES
  153. #define ALMInternalErr                     (-30049)            /*  use kALMInternalErr  */
  154. #define ALMLocationNotFound             (-30048)            /*  use kALMLocationNotFoundErr  */
  155. #define ALMNoSuchModuleErr                 (-30047)            /*  use kALMNoSuchModuleErr  */
  156. #define ALMModuleCommunicationErr         (-30046)            /*  use kALMModuleCommunicationErr  */
  157. #define ALMDuplicateModuleErr             (-30045)            /*  use kALMDuplicateModuleErr  */
  158. #define ALMInstallationErr                 (-30044)            /*  use kALMInstallationErr  */
  159. #define ALMDeferSwitchErr                 (-30043)            /*  use kALMDeferSwitchErr  */
  160.  
  161. /* Old ALMConfirmName constants... */
  162.  
  163. #define ALMConfirmRenameConfig             1
  164. #define ALMConfirmReplaceConfig         2
  165.  
  166. /* Old AppleEvents... */
  167.  
  168. #define kAELocationNotice                 'walk'
  169. #endif
  170.  
  171. #endif /* __LOCATIONMANAGER_R__ */
  172.  
  173.